<template>
  <!-- 头部背景图 -->
  <view class="header">
    <!-- 背景图容器 -->
    <view class="header-bg">
      <image src="/static/tesy.jpg" mode="aspectFill" class="bg-image"></image>
    </view>
  </view>
  <!-- 主体内容 -->
  <view class="main-content">
    <!-- 第一行功能 -->
    <view class="function-row">
      <view class="function-item">
        <image src="/static/cream.jpg" class="icon" />
        <text>拍照功能</text>
      </view>
      <view class="function-item">
        <image src="/static/c2.png" class="icon" />
        <text>朋友圈交友</text>
      </view>
      <view class="function-item">
        <image src="/static/c3.png" class="icon" />
        <text>公众号文章</text>
      </view>
    </view>

    <view class="button-group">
      <navigator url="../function-wechat/function-wechat">
        <button class="button-group_css" style="color: seashell;background-color: red;">其他微信功能</button>
      </navigator>
      <navigator url="../function-study/function-study">
        <button class="button-group_css1" style="color: seashell;background-color: red;">学习其他APP功能</button>
      </navigator>
      <navigator url="../function-emotion/function-emotion">
        <button class="button-group_css2" style="color: seashell;background-color: red;">情感陪伴</button>
      </navigator>
    </view>

  </view>
</template>

<script>
  export default {
    data() {
      return {

      };
    }
  }
</script>

<style lang="scss">
  .header {
    height: 500rpx; // 根据图片比例调整
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30rpx 40rpx; // 四周留白 左为上下 右为左右

    &-bg {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      overflow: hidden;
      border-radius: 20rpx; // 可选圆角

      .bg-image {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        object-fit: cover;
      }
    }
  }

  .container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
  }

  .button-group {
    width: 680rpx;
    margin-left: 20rpx;
    font-size: 90rpx;
    font-weight: bold;

    .button-group_css {
      height: 110rpx;
      border-radius: 80rpx;
      margin-bottom: 50rpx;
      border: 8rpx solid #000;
    }

    .button-group_css1 {
      height: 110rpx;
      border-radius: 80rpx;
      margin-bottom: 50rpx;
      border: 8rpx solid #000;
    }

    .button-group_css2 {
      height: 110rpx;
      border-radius: 80rpx;
      margin-bottom: 50rpx;
      border: 8rpx solid #000;
    }
  }



  .main-content {
    flex: 1;
    padding: 20rpx;
    overflow-y: auto;
  }

  .function-row {
    display: flex;
    justify-content: space-between;
    margin: 20rpx 0;

    .function-item {
      width: 30%;
      background: #fff;
      border-radius: 10rpx;
      padding: 20rpx;
      display: flex;
      flex-direction: column;
      align-items: center;

      .icon {
        width: 80rpx;
        height: 80rpx;
        margin-bottom: 10rpx;
      }
    }
  }

  .section {
    background: #fff;
    border-radius: 10rpx;
    margin: 20rpx 0;
    padding: 20rpx;

    .section-title {
      font-weight: bold;
      margin-bottom: 20rpx;
      display: block;
    }

    .grid-3 {
      display: flex;
      justify-content: space-between;

      .item {
        width: 30%;
        text-align: center;
        padding: 20rpx;
        background: #f0f0f0;
        border-radius: 8rpx;
      }
    }

    .grid-2 {
      display: flex;
      justify-content: space-between;

      .item {
        width: 48%;
        text-align: center;
        padding: 20rpx;
        background: #f0f0f0;
        border-radius: 8rpx;
      }
    }
  }

  .tab-bar {
    height: 100rpx;
    background: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #eee;

    .tab-item {
      display: flex;
      flex-direction: column;
      align-items: center;

      &.active {
        color: #07c160;
      }

      .tab-icon {
        width: 50rpx;
        height: 50rpx;
        margin-bottom: 8rpx;
      }
    }
  }
</style>